<?php
/**
 * @return
 * @author 朱乐斌
 * @date
 */

namespace app\api\validate;

use think\Validate;

class loginValidate extends Validate
{

    // 验证规则
    protected $rule = [
        'mobile' => 'require|mobile',
        'password' => 'require|min:6',
        'code' => 'require|number|length:6',
    ];

    // 验证提示
    protected $message = [
        'mobile.require' => '手机号不能为空',
        'mobile.mobile' => '手机号格式不正确',
        'password.require' => '密码不能为空',
        'code.require' => '验证码不能为空',
        'code.number' => '验证码必须为数字',
        'code.length' => '验证码长度为6位',
    ];

    // 验证场景
    protected $scene = [
        'login' => 'mobile,password',
        'registerCode' => 'mobile',
        'register' => 'mobile,password,code'
    ];

}